package com.attendcollatesys.service.impl;


import com.attendcollatesys.entity.WorkDay;
import com.attendcollatesys.mapper.ATDayDetailMapper;
import com.attendcollatesys.mapper.WorkDayMapper;
import com.attendcollatesys.service.WorkDayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


@Service
public class WorkDayServiceImpl implements WorkDayService {
    @Autowired
    private WorkDayMapper workDayMapper;

    @Autowired
    private ATDayDetailMapper atDayDetailMapper;

    @Override
    public int insertBatch(List<WorkDay> list) {
        return workDayMapper.insertBatch(list);
    }

    @Override
    public WorkDay selWorkDayByYrearMonth(String yearMonth) {
        String dateToCheck = "2024-01-01";

        String dateFormatPattern = "^\\d{4}-\\d{2}-\\d{2}$";

        Pattern pattern = Pattern.compile(dateFormatPattern);

        Matcher matcher = pattern.matcher(dateToCheck);

      return workDayMapper.selWorkDayByYrearMonth(yearMonth);
    }

    /**
     * 根据年月返回对应Rtx账号人员的考勤结果   yearMonth的入参格式为yyyyMM
     */
    @Override
    public Map<String, String> attendanceInfo(String yearMonth,String RtxNumber) {


        return null;



    }


}
